﻿var idxbase = new function () {
    //获取当前用户ID 
    this.GetCurrentUserId = function () {
        var userid = $.ajax({
            url: "/Common/GetCurrentUserId",
            type: "GET",
            cache: false,
            async: false
        }).responseText;
        return parseFloat(userid);
    }

    //获取当前用户的店铺Id
    this.GetCurrentUserShopId = function () {
        var userid = $.ajax({
            url: "/Common/GetCurrentUserShopId",
            type: "GET",
            cache: false,
            async: false
        }).responseText;
        return parseFloat(userid);
    }

    //获取当前用户的昵称
    this.GetCurrentUserNickName = function () {
        var nickname = $.ajax({
            url: "/Common/GetCurrentUserNickName",
            type: "GET",
            cache: false,
            async: false
        }).responseText;
        return nickname;
    }

    //检测是否登录
    this.CheckLogin = function () {
        var userid = this.GetCurrentUserId();
        if (userid > 0)
            return true; //已登录
        else
            return false;
    }

    this.GotoLogin = function ()
    {
        window.location.href = "/Members/Account/Login";
    }
}